<script setup>
import {onMounted, ref} from 'vue';
import axios from "axios";
let carousel = ref({
  id: 1,
  photo: "1"
})
let carouselList = ref([]);
// console.log(carousel.value);
onMounted(()=>{
  axios.post("http://localhost:8080/carousel/findAllCarousel").then((res) => {
    carouselList.value = res.data;
    // console.log(carouselList.value)
  })
})

const imgUrl = "http://localhost:8080/";
</script>

<template>
  <div class="text-center">
    <el-carousel trigger="click" height="320px">
      <el-carousel-item v-for="item in carouselList" :key="item">
        <img class="img" :src="imgUrl+item.photo" alt="">
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style scoped lang="scss">
.img{
  width: 100%;
  height: 100%;
}
</style>